# demo03_write.py
# 写入模式打开文件
# fw = open('03.txt', mode='w', encoding='utf-8')
fw = open('img/03.txt', mode='a', encoding='utf-8')
# 写入
# fw.write('hello\n')
# fw.write('world\n')
# fw.write('linux\n')
# fw.write('达内云计算\n')
# 一次写入多个
fw.writelines(['hello\n', 'world\n', 'linux\n'])


# 关闭文件
fw.close()